import request from '@/utils/request'

// 查询消耗记录列表
export function listConsumeRecords(query) {
  return request({
    url: '/system/consumeRecords/list',
    method: 'get',
    params: query
  })
}

// 查询消耗记录列表(管理)
export function listConsumeRecordsAdmin(query) {
  return request({
    url: '/system/consumeRecords/adminList',
    method: 'get',
    params: query
  })
}


// 查询消耗记录详细
export function getConsumeRecords(id) {
  return request({
    url: '/system/consumeRecords/' + id,
    method: 'get'
  })
}

// 新增消耗记录
export function addConsumeRecords(data) {
  return request({
    url: '/system/consumeRecords',
    method: 'post',
    data: data
  })
}

// 修改消耗记录
export function updateConsumeRecords(data) {
  return request({
    url: '/system/consumeRecords',
    method: 'put',
    data: data
  })
}

// 删除消耗记录
export function delConsumeRecords(id) {
  return request({
    url: '/system/consumeRecords/' + id,
    method: 'delete'
  })
}


// 项目列表
export function getProList() {
  return request({
    url: '/system/consumeRecords/getProList',
    method: 'get'
  })
}
// 汇总统计
export function summary(type) {
  return request({
    url: '/system/consumeRecords/summary/'+type,
    method: 'post',
  })
}

//全部统计
export function allSummary(data) {
  return request({
    url: '/system/consumeRecords/allSummary',
    method: 'post',
    data: data
  })
}

//个人统计
export function mySummary(data) {
  return request({
    url: '/system/consumeRecords/mySummary',
    method: 'post',
    data: data
  })
}
